// Written by Dale J Williams.
// Licensed under MPL 1.1 unless otherwise specified. 
// http://www.mozilla.org/MPL/MPL-1.1.html

package engineDJW.utils {
	/**
	 * ...
	 * @author Dale J Williams
	 */
	public class QuickMath {
		
		static public const RADIANS	:Number = Math.PI / 180;
		static public const DEGREES	:Number = 180 / Math.PI;
		
		static public function max(value1:Number, value2:Number):Number {
			return value1 > value2 ? value1 : value2;
		}		
		static public function min(value1:Number, value2:Number):Number {
			return value1 < value2 ? value1 : value2;
		}
		static public function abs(value:Number):Number {
			return value < 0 ? -value : value;
		}
		static public function limit(value:Number, min:Number, max:Number):Number {
			value = value > min ? value : min;
			return value < max ? value : max;
		}
		static public function round(value:Number):Number {
			return int(value + 0.5);
		}
		
	}

}